package com.qf2.service.impl;


import com.qf2.dao.OrderDao;
import com.qf2.service.OrderService;

import java.util.*;

public class OrderServiceImpl implements OrderService {

    //依赖：当前的OrderService依赖于OrderDao的
    private OrderDao orderDao;

    private int age;

    /*
        特殊类型的数据注入
     */
    private List list;
    private Map map;
    private Properties pro;
    private Set set;
    private String[] array;

    public void setList(List list) {
        this.list = list;
    }

    public void setMap(Map map) {
        this.map = map;
    }

    public void setPro(Properties pro) {
        this.pro = pro;
    }

    public void setSet(Set set) {
        this.set = set;
    }

    public void setArray(String[] array) {
        this.array = array;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //注入 -- 通过set方法注入
    public void setOrderDao(OrderDao orderDao) {
        this.orderDao = orderDao;
    }

    //注入 - 通过构造方法注入
    public OrderServiceImpl(OrderDao orderDao) {
        this.orderDao = orderDao;
    }

    public OrderServiceImpl(OrderDao orderDao, int age) {
        this.orderDao = orderDao;
        this.age = age;
    }

    public OrderServiceImpl() {
    }

    @Override
    public void show() {
        System.out.println("dao是：" + orderDao + "==age:" + age);
    }

    @Override
    public String toString() {
        return "OrderServiceImpl{" +
                "list=" + list +
                ", map=" + map +
                ", pro=" + pro +
                ", set=" + set +
                ", array=" + Arrays.toString(array) +
                '}';
    }
}
